package f.h.dragon.patterns.gateway;

import org.apache.log4j.Logger;

/**
 * Environment TODO
 *
 * @author Wenlong Meng(wenlong.meng@gmail.com)
 * @version 1.0 at 2012-4-23
 * @since 1.0
 */
public class Environment {
	
	//local variables
	/**
	 * logger
	 */
	private static Logger logger = Logger.getLogger(Environment.class);
	/**
	 * Message Gateway
	 */
	private static MessageGateway mg = null;

	//Logic
	/**
	 * test Init
	 */
	public static void testInit() {
		logger.debug("test init...");
		mg = new MessageGatewayStub();
	}
	
	/**
	 * Init
	 */
	public static void init() {
		logger.debug("init...");
		mg = new MessageGateway();
	}

	/**
	 * get the gateway of message
	 * 
	 * @return
	 */
	public static MessageGateway getMessageGateway() {
		return mg;
	}

}
